package com.amat0urheu.dao;

import com.amat0urheu.pojo.UploadFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;



@Mapper
public interface UploadFileDao extends BaseMapper<UploadFile> {

    @Select("select * from upload_file where user=#{user} and experiment=#{experimentName}")
    UploadFile judgeIfExitByFileName(String user, String experimentName);
    @Select("select file_path from upload_file where user=#{user} and experiment=#{experimentName}")
    String getFilePath(String user, String experimentName);
    @Select("select file_path from upload_file where  experiment=#{experimentName}")
    List<String> getFilePaths(String experimentName);
    @Delete("delete from upload_file")
    void removeAllFiles();
}
